﻿@namespace MudBlazor
@inherits MudComponentBase

<div @attributes="UserAttributes" class="@Classname" @onclick="OnClickHandler" @onclick:stopPropagation="true" style="@Style">
    @if (!String.IsNullOrEmpty(Avatar))
    {
        <div class="mud-list-item-avatar">
            <MudAvatar Class="@AvatarClass">
                <MudIcon Icon="@Avatar" Color="@IconColor"></MudIcon>
            </MudAvatar>
        </div>
    }
    else if (!String.IsNullOrEmpty(Icon))
    {
        <div class="mud-list-item-icon">
            <MudIcon Icon="@Icon" Color="@IconColor"></MudIcon>
        </div>
    }
    <div class="mud-list-item-text @(Inset? "mud-list-item-text-inset" : "")">
        <MudText Typo="@_textTypo">
            @if (ChildContent!=null)
            {
                @ChildContent
            }
            else
            {
                @Text
            }
        </MudText>
    </div>
    @if (NestedList != null)
    {
        @if (_expanded)
        {
            <MudIcon Icon="@Icons.Material.Filled.ExpandLess"/>
        }
        else
        {
            <MudIcon Icon="@Icons.Material.Filled.ExpandMore"/>
        }
    }
</div>
@if (NestedList != null)
{
    <MudCollapse Expanded="@Expanded">
        <MudList Clickable="@MudList.Clickable" DisablePadding="true" Class="mud-nested-list" Disabled="@Disabled">
            @NestedList
        </MudList>
    </MudCollapse>
}